package com.hospital.wx.pojo.wx;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/*
* 微信API响应对象
* */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ApiResponse {
    private Integer code;      // 状态码
    private String message;    // 消息
    private Object result;     // 结果数据

    public static ApiResponse success(Object data) {
        return new ApiResponse(200, "操作成功", data);
    }

    public static ApiResponse error(String message) {
        return new ApiResponse(400, message, null);
    }
}
